package demo1103.demo03;

import java.util.function.Consumer;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/11/3 12:41
 */
public class TestConsumer {
    public static void main(String[] args) {
        Consumer<Integer> c = time->{
            System.out.println("打游戏花费了"+time+"个小时");
        };
        play(c,2);
    }
    public static void play(Consumer<Integer> consumer,Integer time){
        consumer.accept(time);
    }
}
